const mysql = require("mysql");
var pool = mysql.createPool({
    host: '192.168.91.166',
    user: 'root',
    password: 'ddd',
    database: 'LMS'
});

function excute(sqlString, condition) {
    let result = new Promise((resolve, reject) => {
        pool.query(sqlString, condition, function (error, result, fields) {
            if (error) {
                reject(error);
            } else {
                resolve(result);
            }
        })
    })
    return result;
}

module.exports = {
    EXCUTE: excute
}